import React, { memo, useState } from 'react'
import { Button } from 'antd'

import TableNoWrapToolTips from './index-nowrap'
import TableMultiToolTips from './index-mutil'

const TableToolTips = memo(() => {
  const [isNowrap, setIsNowrap] = useState(true)
  return (
    <div>
      <Button type="primary" onClick={() => setIsNowrap(!isNowrap)}>{isNowrap ? '单行' : '多行'}</Button>
      {
        isNowrap ? (
          <TableNoWrapToolTips />
        ) : (
          <TableMultiToolTips />
        )
      }
    </div>
  )
})

export default TableToolTips